#pragma once
#include<iostream>
#include<fstream>
class Box;
class Sprite;
class StaticObject;
class Bridge;
#include <d3dx9.h>
#include <list>

#include "StaticObject.h"
#include "GameDefine.h"


class WallTurret;
class Sniper;
class StandSniper;

class DefenseCannon;

class Cannon;
class Object;
class Boss;
class ScubaSoldier;
class Player;
using namespace std;

class Map
{		
	int** _arrMap;
	int _width, _height;
	Sprite* _sMap;	
	list<D3DXVECTOR2> _lWallTurret;	
	list<D3DXVECTOR2> _lStandSniper;	
	list<D3DXVECTOR2> _lSniper;	
	list<D3DXVECTOR2> _lCannon;	
	list<D3DXVECTOR2> _lDefenseCannon;	
	list<D3DXVECTOR2> _lBoss;	
	list<D3DXVECTOR2> _lBridge;
	list<D3DXVECTOR2> _lScubaSoldier;
	list<D3DXVECTOR2> _lPlayer;
	list<D3DXVECTOR2> _lBarracks;
	list<StaticObject*> _lStaticObj;
	string _objName;
	int _numObj;

public:	
	Map(SPRITE_ID id);
	~Map(void);
	void readMap(string fileName);
	list<D3DXVECTOR2> readListObjectPosition(ifstream* stream);
	D3DXVECTOR2 readObjectPosition(ifstream* stream);
	void readStaticObject(ifstream* stream, STATIC_ID id);
	void render();	
	void resetMap(int i, int j, int frame);
	list<StaticObject*> getStaticObjects();
	list<Bridge*> getStaticBridge();	
	list<Object*> getObject();
	list<D3DXVECTOR2> getPlayer();
	list<D3DXVECTOR2> getBarracks();
	int getWidth();
	int getHeight();
};

